package com.yn.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;


@AllArgsConstructor
@Getter
public enum AppointmentStatusEnum {

    SUBMITTED (0,  "预约提交"),
    SUCCESS( 1, "预约成功"),
    CANCELED( 2, "取消预约");

    private Integer code;
    private String name;

    public static AppointmentStatusEnum getByCode(Integer code) {
        if (null == code) {
            return null;
        }
        for (AppointmentStatusEnum appointmentStatusEnum : AppointmentStatusEnum.values()) {
            if (appointmentStatusEnum.getCode().equals(code)) {
                return appointmentStatusEnum;
            }
        }
        return null;
    }
}
